﻿namespace TC
{
    public class GetObject<T> : VariableNode
    {
        public string key;
        public ValueInput<string> keyIn; // todo 刪掉
        public ValueOutput<T> valueOut;

        public override void OnCreate()
        {
            base.OnCreate();

            keyIn = this.AddValueInPort<string>("keyIn");
            valueOut = this.AddValueOutPort<T>("valueOut",
                () =>
                {
                    return graph.context.Get<T>(key);
                });
        }
    }
}
